re-instate gsshortnames option in gpx.c
authoralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 8 Mar 2004 22:39:01 +0000 (22:39 +0000)
committeralexmot <alexmot@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 8 Mar 2004 22:39:01 +0000 (22:39 +0000)
gpsbabel/gpx.c

index 9eae7af9b278366ff9db462aed467e059847c1c6..f71bd0a702f1196bac68b4a7d5a6225d672d10f0 100644 (file)
@@ -77,6 +77,7 @@ typedef enum {
        tt_wpt_time,
        tt_wpt_type,
        tt_wpt_urlname,
+       tt_cache_name,
        tt_cache_container,
        tt_cache_type,
        tt_cache_difficulty,
@@ -144,6 +145,7 @@ tag_mapping tag_path_map[] = {
        { tt_wpt_urlname, 0, "/gpx/wpt/urlname" },
        { tt_wpt_sym, 0, "/gpx/wpt/sym" },
        { tt_wpt_type, 1, "/gpx/wpt/type" },
+       { tt_cache_name, 1, "/gpx/wpt/groundspeak:cache/groundspeak:name" },
        { tt_cache_container, 1, "/gpx/wpt/groundspeak:cache/groundspeak:container" },
        { tt_cache_type, 1, "/gpx/wpt/groundspeak:cache/groundspeak:type" },
        { tt_cache_difficulty, 1, "/gpx/wpt/groundspeak:cache/groundspeak:difficulty" },
@@ -598,6 +600,13 @@ gpx_end(void *data, const char *el)
                cur_tag = NULL;
                wpt_tmp = NULL;
                break;
+       case tt_cache_name:
+               if (gsshortnames) {
+                       if (wpt_tmp->notes)
+                               xfree(wpt_tmp->notes);
+                       wpt_tmp->notes = xstrdup(cdatastrp);
+               }
+               break;
        case tt_cache_container:
                wpt_tmp->gc_data.container = gs_mkcont(cdatastrp);
                break;